package com.example.yk_lx.addmember;

import androidx.lifecycle.MutableLiveData;

import com.example.yk_lx.baseMVVM.BaseRepo;
import com.hyphenate.exceptions.HyphenateException;

public class AddmemberRepo extends BaseRepo {
    public void addmember(String groupId, String[] members, MutableLiveData<String> success,MutableLiveData<String> fail){
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    client.groupManager().addUsersToGroup(groupId,members);
                    success.postValue("添加成员成功");
                } catch (HyphenateException e) {
                    //throw new RuntimeException(e);
                    fail.postValue("添加成员失败");
                }
            }
        }).start();

    }
}
